package com.bxj.wxtt.service.impl;

import com.bxj.wxtt.api.domain.AdvContent;
import com.bxj.wxtt.mapper.master.AdvContentMasterMapper;
import com.bxj.wxtt.mapper.slave.AdvContentSlaveMapper;
import com.bxj.wxtt.service.AdvContentService;
import com.ifeng.matrix.common.domain.PageResult;
import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Component;

/**
 * 由MyBatis Generator工具自动生成 2018-07-18 19:49:05
 */
@Component("advContentService")
public class AdvContentServiceImpl implements AdvContentService {
    @Resource
    AdvContentMasterMapper advContentMasterMapper;

    @Resource
    AdvContentSlaveMapper advContentSlaveMapper;

    public List<AdvContent> getAdvContentList(AdvContent advContent) {
        return advContentSlaveMapper.getAdvContentList(advContent);
    }

    public AdvContent selectById(Long id) {
        return advContentSlaveMapper.selectById(id);
    }

    public PageResult<AdvContent> getAdvContentPage(AdvContent advContent) {
        PageResult pageResult = new PageResult();
        pageResult.setCount(advContentSlaveMapper.countSeletive(advContent));
        pageResult.setResult(advContentSlaveMapper.getAdvContentList(advContent));
        return pageResult;
    }

    public int insert(AdvContent advContent) {
        return advContentMasterMapper.insert(advContent);
    }

    public int deleteAdvContentById(Long id) {
        return advContentMasterMapper.deleteAdvContentById(id);
    }

    public int updateAdvContentById(AdvContent advContent) {
        return advContentMasterMapper.updateAdvContentById(advContent);
    }
}